package com.gitee.wsl.transform.validator.string.ext

import com.gitee.wsl.transform.validator.string.StringValidator
import com.gitee.wsl.transform.validator.string.then


fun StringValidator.allLowerCase() = then("not all lowercase"){
    it == it.lowercase()
}

fun StringValidator.allUpperCase() = then("not all UpperCase"){
    it == it.uppercase()
}

fun StringValidator.atLeastOneLowerCase() = regex("^(?=.*[a-z]).+\$")

fun StringValidator.atLeastOneNumberCase() = regex(".*\\d.*")

fun StringValidator.noSpecialCharacter() = regex("[A-Za-z0-9]+")

//val AtLeastOneUpercCaseRule: StringValidator =RegexRuleValidator("[A-Za-z0-9]+")